Option Explicit

' ==========================================
' for SelectItem.vb
' ==========================================
Public Enum SqlEnum_SelectItemType
    ' ALL = 通配符 `*`
    ALL = 1
    ' Column = 某个表中的列
    REAL_COLUMN = 2
    ' Function = 一个函数
    FUNC = 3
End Enum

' ==========================================
' for FromItem.vb
' ==========================================
Public Enum SqlEnum_FromItemType
    ' 主表
    MAIN = 1
    ' 左连接表
    LEFT_JOIN = 2
    ' 右连接表
    RIGHT_JOIN = 3
    ' 内连接表
    INNER_JOIN = 4
    ' Cross
    CROSS = 5
End Enum

' ==========================================
' 表类型
' ==========================================
' 实际表
' Public Const TABLE_TYPE_REAL As String = "tableTypeReal"
' 子查询表
' Public Const TABLE_TYPE_SUB_SELECT As String = "tableTypeSubSelect"

' ==========================================
' 比较运算符
' ==========================================
Public Enum SqlEnum_CompareOperator
    ' =
    EQUAL = 1
    ' !=, <>
    NO_EQUAL = 2
    ' <, &lt;
    LESS  = 3
    ' >, &gt;
    GREATER = 4
    ' <=, &lt;=
    LESS_EQUAL = 5
    ' >=, &gt;=
    GREATER_EQUAL = 6
    ' in
    CO_IN  = 7
    ' IS
    CO_IS = 8
    ' between and
    BETWEEN_AND = 9
    ' 出现嵌套条件时使用, And
    CO_AND = 10
    ' 出现嵌套条件时使用, Or
    CO_OR = 11
End Enum

' ==========================================
' 条件运算符
' ==========================================
Public Enum SqlEnum_ConditionOperator
    ' and
    COND_AND = 1
    ' or
    COND_OR = 2
End Enum

' ==========================================
' 比较元素的类型
' ==========================================
' 表中的列
' Public Const COMPARE_ELEM_TYPE_COLUMN As String = "compareElementTypeColumn"
' ' 数字
' Public Const COMPARE_ELEM_TYPE_NUMBER As String = "compareElementTypeNumber"
' ' 字符串
' Public Const COMPARE_ELEM_TYPE_STRING As String = "compareElementTypeString"
' ' 函数
' Public Const COMPARE_ELEM_TYPE_FUNCTION As String = "compareElementTypeFunction"
' ' 子查询
' Public Const COMPARE_ELEM_TYPE_SUB_SELECT As String = "compareElementTypeSubSelect"

' ==========================================
' 列的类型
' ==========================================
Public Enum SqlEnum_ColumnItemType
    ' 表中的列
    CI_REAL_COLUMN = 1
    ' 数字
    CI_NUMBER = 2
    ' 字符串
    CI_STRING = 3
    ' 函数
    CI_FUNCTION = 4
End Enum

' ==========================================
' 排序类型
' ==========================================
Public Enum SqlEnum_OrderType
    ' 升序
    OT_ASC = 1
    ' 降序
    OT_DESC = 2
End Enum

' ==========================================
' 表达式返回值的类型
' ==========================================
Public Enum SqlEnum_ExpressionValueType
    ' 字符串
    EV_STR = 1
    ' 数字
    EV_NUMBER = 2
    ' 日期字符串 (只能包含 年月日)
    EV_DATE_STRING = 3
    ' 具体时间字符串 (只能包含 时分秒)
    EV_TIME_STRING = 4
    ' 时间戳字符串  (只能包含 年月日时分秒)
    EV_TIMESTAMP_STRING = 5
End Enum

' ==========================================
' union 的类型
' ==========================================
Public Enum SqlEnum_SqlUnionType
    ' union
    UT_UNION = 1
    ' union all
    UT_UNION_ALL = 2
End Enum

' ==========================================
' sql 的类型
' ==========================================
Public Enum SqlEnum_SqlType
    ' select
    TYPE_SELECT = 1
    ' union
    TYPE_UNOIN = 2
End Enum
